package cn.maxwell.controller;

import cn.maxwell.FeiClient.UserFeiGinClient;
import cn.maxwell.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 主配置类增加@EnableFeignClients标签 , 其value属性可以指定Feign的客户端接口的包,当然也可以省略value属性
 */
@RestController
public class PayController {
    @Autowired
    private UserFeiGinClient userFeiGinClient;

    //浏览器来掉
    @RequestMapping("/pay/{id}")
    public User getById(@PathVariable("id")Long id){
        //使用Feign调用用户服务获取User
        return userFeiGinClient.loadById(id);
    }
}
